<form name="f" method="post">
<?php
	require("../include/connectdb.php");
	$type=$_GET['type'];
	$s=null;
	switch($type){
		case 'dm': 
			$s="domain";
			break;
		case 'pm': 
			$s="phanmem";
			break;
		case 'sp': 
			$s="sanpham";
			break;
		case 't2': 
			$s="tintuc";
			break;
		case 'tv': 
			$s="tuvan";
			break;
		case 'w': 
			$s="web";
			break;
		case 'dv': 
			$s="dichvu";
			break;					
	}
	$sql="select * from ".$s." order by ".$type."Id DESC";
	$res=mysql_query($sql);
	while($r=mysql_fetch_array($res)){
		$ID=$r[$type.'Id'];
?>

<div class="grid_5 artIco  alpha" style="margin-right:0; margin-left:4px;">
	<p ><?php echo substr($r[$type.'Title'],0,30);?> </p>
	<br>
	<div class="grid_5"><?php echo substr($r[$type.'Detail'],0,100);?></div>
	<br>
	<div align="right">
		<a href="#">Chi tiết</a>
		&nbsp;&nbsp;
		<a href="main.php?page=eart&type=<?php echo $type; ?>&ID=<?php echo $ID; ?>">Sửa</a>
		&nbsp;&nbsp;
		<a href="include/articlesProc.php?type=<?php echo $type;?>&act=del&ID=<?php echo $ID;?>">Xóa</a>
	</div>
</div>
<?php
	if($r=mysql_fetch_array($res)){
?>
<div class="grid_5 artIco omega">

	<p><?php echo substr($r[$type.'Title'],0,30);?> </p>
	<br>
	<div class="grid_5"><?php echo substr($r[$type.'Detail'],0,100);?></div>
	<br>
	<div align="right">
		<a href="#">Chi tiết</a>
		&nbsp;&nbsp;
		<a href="main.php?page=eart&type=<?php echo $type; ?>&ID=<?php echo $ID; ?>">Sửa</a>
		&nbsp;&nbsp;
		<a href="include/articlesProc.php?type=<?php echo $type;?>&act=del&ID=<?php echo $ID;?>">Xóa</a>
	</div>
</div>
<?php
	}
}
?>
</form>